package cn.zdm.demo2.common.result;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * copyright (C), 2021, 武大吉奥科技有限公司
 *
 * @Program demo2
 * @Description 返回结果
 * @Author ZhaoDeman
 * @Create 2021/1/19 21:57
 * @Version 1.0.0
 * <author>                <time>                  <version>                   <description>
 * ZhaoDeman        2021/1/19 21:57                 1.0
 */
@ApiModel(value = "ResultObject<T>", description = "返回状态信息")
public class ResultObject<T> {
    /**
     * 返回状态码
     */
    @ApiModelProperty(name = "code", value = "响应状态码")
    private Integer code;
    /**
     * 返回消息
     */
    @ApiModelProperty(name = "msg", value = "响应结果消息")
    private String msg;
    /**
     * 数据
     */
    @ApiModelProperty(name = "data", value = "响应的结果数据")
    private T data;
    /**
     * 统计数据列数（如果存在）
     */
    @ApiModelProperty(name = "count", value = "统计列数")
    private Integer count;

    public Integer getCode() {
        return code;
    }

    public ResultObject<T> setCode(Integer code) {
        this.code = code;
        return this;
    }

    public String getMsg() {
        return msg;
    }

    public ResultObject<T> setMsg(String msg) {
        this.msg = msg;
        return this;
    }

    public T getData() {
        return data;
    }

    public ResultObject<T> setData(T data) {
        this.data = data;
        return this;
    }

    public Integer getCount() {
        return count;
    }

    public ResultObject<T> setCount(Integer count) {
        this.count = count;
        return this;
    }
}
